package org.ontoexplorer.test.general;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PasswordDemo {
	
	
	
    public static void main(String[] argv) {
    	JFrame f = new JFrame("PasswordDemo");

        JLabel label = new JLabel("Enter the password: ");
        final JTextField passwordField = new JTextField(10);
        passwordField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.out.println(passwordField.getText());
            }
        });

        JPanel contentPane = new JPanel(new BorderLayout());
        contentPane.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));        
        contentPane.add(passwordField, BorderLayout.CENTER);

        f.setContentPane(contentPane);
        f.pack();
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) { System.exit(0); }
        });
        f.setVisible(true);
    }
  
}
